/*
 * Copyright (C), 2002-2017, 苏宁易购电子商务有限公司
 * FileName: Model.java
 * Author:   15050536
 * Date:     2017年1月6日 上午9:42:59
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.suning.sawp.po.mainpushnew;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 款数表对应的实体
 *
 * 某一总部任务 对应的款数
 * 
 * @author 15050536 石键平
 */
@Entity(name = "model")
public class Model implements Serializable {

	/**
	 */
	private static final long serialVersionUID = -4601421653597495575L;

	/**
	 * 主键
	 */
	private Long id;

	/**
	 * 总部任务id
	 */
	private Long hqTaskId;

	/**
	 * 品类编码
	 */
	private String cateCode;

	/**
	 * 品类名称
	 */
	private String cateName;

	/**
	 * 款数名称
	 */
	private String modelName;

	/**
	 * 主推类型 -- A,B
	 */
	private String taskType;

	/**
	 * 目标数量 当前品类某月的主推任务下，此款数目标台数
	 */
	private Integer targetNum;

	public Model() {
	}

	/**
	 * @param cateCode
	 * @param cateName
	 * @param modelName
	 * @param taskType
	 */
	public Model(String cateCode, String cateName, String modelName, String taskType) {
		this.cateCode = cateCode;
		this.cateName = cateName;
		this.modelName = modelName;
		this.taskType = taskType;
	}

	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "hq_task_id")
	public Long getHqTaskId() {
		return hqTaskId;
	}

	public void setHqTaskId(Long hqTaskId) {
		this.hqTaskId = hqTaskId;
	}

	@Column(name = "cate_code")
	public String getCateCode() {
		return cateCode;
	}

	public void setCateCode(String cateCode) {
		this.cateCode = cateCode;
	}

	@Column(name = "cate_name")
	public String getCateName() {
		return cateName;
	}

	public void setCateName(String cateName) {
		this.cateName = cateName;
	}

	@Column(name = "model_name")
	public String getModelName() {
		return modelName;
	}

	public void setModelName(String modelName) {
		this.modelName = modelName;
	}

	@Column(name = "task_type")
	public String getTaskType() {
		return taskType;
	}

	public void setTaskType(String taskType) {
		this.taskType = taskType;
	}

	@Column(name = "target_num")
	public Integer getTargetNum() {
		return targetNum;
	}

	public void setTargetNum(Integer targetNum) {
		this.targetNum = targetNum;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((cateCode == null) ? 0 : cateCode.hashCode());
		result = prime * result + ((cateName == null) ? 0 : cateName.hashCode());
		result = prime * result + ((modelName == null) ? 0 : modelName.hashCode());
		result = prime * result + ((taskType == null) ? 0 : taskType.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Model other = (Model) obj;
		if (cateCode == null) {
			if (other.cateCode != null)
				return false;
		} else if (!cateCode.equals(other.cateCode))
			return false;
		if (cateName == null) {
			if (other.cateName != null)
				return false;
		} else if (!cateName.equals(other.cateName))
			return false;
		if (modelName == null) {
			if (other.modelName != null)
				return false;
		} else if (!modelName.equals(other.modelName))
			return false;
		if (taskType == null) {
			if (other.taskType != null)
				return false;
		} else if (!taskType.equals(other.taskType))
			return false;
		return true;
	}

}
